home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
PCIPlugin.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
12KB
|
272 lines
{
File: PCIPlugin.p
Contains: This file contains all interface related structures and prototypes for pci expert to plugin
Version: Technology: Copland
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT PCIPlugin;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __PCIPLUGIN__}
{$SETC __PCIPLUGIN__ := 1}
{$I+}
{$SETC PCIPluginIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __PCICOMMONPLUGIN__}
{$I PCICommonPlugin.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{ subordinate pci device tree 'reg' property structure definition }
TYPE
PCIRegPropertyPtr = ^PCIRegProperty;
PCIRegProperty = RECORD
physicalHigh: UInt32;
physicalMiddle: UInt32;
physicalLow: UInt32;
propAddress: UInt32;
propLength: UInt32;
END;
{ pci device tree 'bus-range' property structure definition }
PCIBusRangePropertyPtr = ^PCIBusRangeProperty;
PCIBusRangeProperty = RECORD
lowBus: UInt32;
highBus: UInt32;
END;
{ subordinate pci device description table entry header structure definition }
ConfigAddress = LogicalAddress;
IOAddress = LogicalAddress;
PCIDeviceTableEntryHeaderPtr = ^PCIDeviceTableEntryHeader;
PCIDeviceTableEntryHeader = RECORD
entry: RegEntryRef;
name: PACKED ARRAY [0..31] OF CHAR;
pciDomain: UInt32;
pciBusNumber: UInt32;
pciSecondBusNumber: UInt32;
accessType: UInt32;
regProperty: PCIRegPropertyPtr;
regPropertyCount: ByteCount;
ioBase: IOAddress;
rangeBase: LogicalAddress;
END;
{ subordinate pci device description table entry structure definition }
PCIDeviceTableEntryPtr = ^PCIDeviceTableEntry;
PCIDeviceTableEntry = RECORD
nextDeviceEntry: PCIDeviceTableEntryPtr;
header: PCIDeviceTableEntryHeader;
BridgePlugin: PCIBridgeDescriptorPtr;
pluginSpecificStuff: ARRAY [0..15] OF UInt32;
END;
{ type defs for plugin interfaces }
ConfigReadByteFuncPtr = ProcPtr; { FUNCTION ConfigReadByteFuncPtr(configAddr: ConfigAddress; VAR valuePtr: UInt8; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
ConfigReadWordFuncPtr = ProcPtr; { FUNCTION ConfigReadWordFuncPtr(configAddr: ConfigAddress; VAR valuePtr: UInt16; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
ConfigReadLongFuncPtr = ProcPtr; { FUNCTION ConfigReadLongFuncPtr(configAddr: ConfigAddress; VAR valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
ConfigWriteByteFuncPtr = ProcPtr; { FUNCTION ConfigWriteByteFuncPtr(configAddr: ConfigAddress; valuePtr: ByteParameter; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
ConfigWriteWordFuncPtr = ProcPtr; { FUNCTION ConfigWriteWordFuncPtr(configAddr: ConfigAddress; valuePtr: UInt16; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
ConfigWriteLongFuncPtr = ProcPtr; { FUNCTION ConfigWriteLongFuncPtr(configAddr: ConfigAddress; valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOReadByteFuncPtr = ProcPtr; { FUNCTION IOReadByteFuncPtr(ioAddr: IOAddress; VAR valuePtr: UInt8; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOReadWordFuncPtr = ProcPtr; { FUNCTION IOReadWordFuncPtr(ioAddr: IOAddress; VAR valuePtr: UInt16; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOReadLongFuncPtr = ProcPtr; { FUNCTION IOReadLongFuncPtr(ioAddr: IOAddress; VAR valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOWriteByteFuncPtr = ProcPtr; { FUNCTION IOWriteByteFuncPtr(ioAddr: IOAddress; valuePtr: ByteParameter; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOWriteWordFuncPtr = ProcPtr; { FUNCTION IOWriteWordFuncPtr(ioAddr: IOAddress; valuePtr: UInt16; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IOWriteLongFuncPtr = ProcPtr; { FUNCTION IOWriteLongFuncPtr(ioAddr: IOAddress; valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IntAckReadByteFuncPtr = ProcPtr; { FUNCTION IntAckReadByteFuncPtr(VAR valuePtr: UInt8; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IntAckReadWordFuncPtr = ProcPtr; { FUNCTION IntAckReadWordFuncPtr(VAR valuePtr: UInt16; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
IntAckReadLongFuncPtr = ProcPtr; { FUNCTION IntAckReadLongFuncPtr(VAR valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
SpecialCycleWriteLongFuncPtr = ProcPtr; { FUNCTION SpecialCycleWriteLongFuncPtr(valuePtr: UInt32; pciDeviceHead: PCIDeviceTableEntryPtr): OSStatus; C; }
InitDeviceEntryFuncPtr = ProcPtr; { FUNCTION InitDeviceEntryFuncPtr(deviceDescriptor: PCIDeviceTableEntryPtr): OSStatus; C; }
GetIOBaseFuncPtr = ProcPtr; { FUNCTION GetIOBaseFuncPtr(deviceDescriptor: PCIDeviceTableEntryPtr; VAR ioBase: IOAddress): OSStatus; C; }
{ pci domain descriptor definition }
PCIControlDescriptorPtr = ^PCIControlDescriptor;
PCIControlDescriptor = RECORD
InterfaceHeader: PCIPluginHeader;
PCIDeviceDescriptor: PCIDeviceTableEntry;
TheDomainDriverDescription: DriverDescriptionPtr;
InitializeFunc: InitializeFuncPtr;
ConfigReadByteFunc: ConfigReadByteFuncPtr;
ConfigReadWordFunc: ConfigReadWordFuncPtr;
ConfigReadLongFunc: ConfigReadLongFuncPtr;
ConfigWriteByteFunc: ConfigWriteByteFuncPtr;
ConfigWriteWordFunc: ConfigWriteWordFuncPtr;
ConfigWriteLongFunc: ConfigWriteLongFuncPtr;
IOReadByteFunc: IOReadByteFuncPtr;
IOReadWordFunc: IOReadWordFuncPtr;
IOReadLongFunc: IOReadLongFuncPtr;
IOWriteByteFunc: IOWriteByteFuncPtr;
IOWriteWordFunc: IOWriteWordFuncPtr;
IOWriteLongFunc: IOWriteLongFuncPtr;
IntAckReadByteFunc: IntAckReadByteFuncPtr;
IntAckReadWordFunc: IntAckReadWordFuncPtr;
IntAckReadLongFunc: IntAckReadLongFuncPtr;
SpecialCycleWriteLongFunc: SpecialCycleWriteLongFuncPtr;
InitDeviceEntryFunc: InitDeviceEntryFuncPtr;
GetIOBaseFunc: GetIOBaseFuncPtr;
FinalizeFunc: FinalizeFuncPtr;
END;
{ Prototypes for the PIM }
FUNCTION PCIPluginInitialize: OSStatus; C;
FUNCTION PCIPluginConfigReadByte(configAddr: ConfigAddress; VAR valuePtr: UInt8; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginConfigReadWord(configAddr: ConfigAddress; VAR valuePtr: UInt16; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginConfigReadLong(configAddr: ConfigAddress; VAR valuePtr: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginConfigWriteByte(configAddr: ConfigAddress; value: ByteParameter; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginConfigWriteWord(configAddr: ConfigAddress; value: UInt16; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginConfigWriteLong(configAddr: ConfigAddress; value: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOReadByte(ioAddr: IOAddress; VAR valuePtr: UInt8; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOReadWord(ioAddr: IOAddress; VAR valuePtr: UInt16; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOReadLong(ioAddr: IOAddress; VAR valuePtr: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOWriteByte(ioAddr: IOAddress; value: ByteParameter; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOWriteWord(ioAddr: IOAddress; value: UInt16; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIOWriteLong(ioAddr: IOAddress; value: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIntAckReadByte(VAR valuePtr: UInt8; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIntAckReadWord(VAR valuePtr: UInt16; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginIntAckReadLong(VAR valuePtr: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginSpecialCycleWriteLong(value: UInt32; pciDeviceEntry: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginInitDeviceEntry(deviceDescriptor: PCIDeviceTableEntryPtr): OSStatus; C;
FUNCTION PCIPluginGetIOBase(deviceDescriptor: PCIDeviceTableEntryPtr; VAR ioBase: IOAddress): OSStatus; C;
FUNCTION PCIPluginFinalize: OSStatus; C;
{ general purpose pci masks }
CONST
kPCIconfigAddrReservedValue = $00000000;
kPCIconfigAddrReservedMask = $FF000000;
kPCIconfigAddrBusNumberMask = $00FF0000;
kPCIconfigAddrDeviceNumberMask = $0000F800;
kPCIconfigAddrFunctionNumberMask = $00000700;
kPCIconfigAddrRegisterNumberMask = $000000FC;
kPCIconfigAddrAccessTypeMask = $00000001;
kPCIregisterByteMask = $00000003;
kPCIregisterNotByteMask = $FFFFFFFC;
kPCIregisterWordMask = $00000002;
{ pci encoded-int structure constants definition }
kPCIPhysicalHighRelocatableMask = $80000000;
kPCIPhysicalHighRelocatable = $80000000;
kPCIPhysicalHighPrefetchableMask = $40000000;
kPCIPhysicalHighPrefetchable = $40000000;
kPCIPhysicalHighAliasedMask = $20000000;
kPCIPhysicalHighAliased = $20000000;
kPCIPhysicalHighSpaceCodeMask = $03000000;
kPCIPhysicalHighSpaceCodeConfig = $00000000;
kPCIPhysicalHighSpaceCodeIO = $01000000;
kPCIPhysicalHighSpaceCodeMemory = $02000000;
kPCIPhysicalHighSpaceCode64Bit = $03000000;
kPCIPhysicalHighBusMask = $00FF0000;
kPCIPhysicalHighDeviceMask = $0000F800;
kPCIPhysicalHighDevice0 = $00000000;
kPCIPhysicalHighDevice1 = $00000800;
kPCIPhysicalHighDevice2 = $00001000;
kPCIPhysicalHighDevice3 = $00001800;
kPCIPhysicalHighDevice4 = $00002000;
kPCIPhysicalHighDevice5 = $00002800;
kPCIPhysicalHighDevice6 = $00003000;
kPCIPhysicalHighDevice7 = $00003800;
kPCIPhysicalHighDevice8 = $00004000;
kPCIPhysicalHighDevice9 = $00004800;
kPCIPhysicalHighDevice10 = $00005000;
kPCIPhysicalHighDevice11 = $00005800;
kPCIPhysicalHighDevice12 = $00006000;
kPCIPhysicalHighDevice13 = $00006800;
kPCIPhysicalHighDevice14 = $00007000;
kPCIPhysicalHighDevice15 = $00007800;
kPCIPhysicalHighDevice16 = $00008000;
kPCIPhysicalHighDevice17 = $00008800;
kPCIPhysicalHighDevice18 = $00009000;
kPCIPhysicalHighDevice19 = $00009800;
kPCIPhysicalHighDevice20 = $0000A000;
kPCIPhysicalHighDevice21 = $0000A800;
kPCIPhysicalHighDevice22 = $0000B000;
kPCIPhysicalHighDevice23 = $0000B800;
kPCIPhysicalHighDevice24 = $0000C000;
kPCIPhysicalHighDevice25 = $0000C800;
kPCIPhysicalHighDevice26 = $0000D000;
kPCIPhysicalHighDevice27 = $0000D800;
kPCIPhysicalHighDevice28 = $0000E000;
kPCIPhysicalHighDevice29 = $0000E800;
kPCIPhysicalHighDevice30 = $0000F000;
kPCIPhysicalHighDevice31 = $0000F800;
kPCIPhysicalHighFunctionMask = $00000700;
kPCIPhysicalHighFunction0 = $00000000;
kPCIPhysicalHighFunction1 = $00000100;
kPCIPhysicalHighFunction2 = $00000200;
kPCIPhysicalHighFunction3 = $00000300;
kPCIPhysicalHighFunction4 = $00000400;
kPCIPhysicalHighFunction5 = $00000500;
kPCIPhysicalHighFunction6 = $00000600;
kPCIPhysicalHighFunction7 = $00000700;
kPCIPhysicalHighRegisterMask = $000000FF;
kPCIPhysicalHighRegisterVendorID = $00000000;
kPCIPhysicalHighRegisterDeviceID = $00000002;
kPCIPhysicalHighRegisterCommand = $00000004;
kPCIPhysicalHighRegisterRevisionID = $00000008;
kPCIPhysicalHighRegisterCacheLineSIze = $0000000C;
kPCIPhysicalHighRegisterHeaderType = $0000000E;
kPCIPhysicalHighRegisterBaseAddress = $00000010;
kPCIPhysicalHighRegisterBridgeBusInfo = $00000018;
kPCIPhysicalHighRegisterCardbusCIS = $00000028;
kPCIPhysicalHighRegisterSubsystemVendorID = $0000002C;
kPCIPhysicalHighRegisterExpansionROMBase = $00000030;
kPCIPhysicalHighRegisterInterruptLine = $0000003C;
{ pci cycle access type for forwarding }
kPCIaccessType0 = 0;
kPCIaccessType1 = 1;
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := PCIPluginIncludes}
{$ENDC} {__PCIPLUGIN__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}